<template>
  <div class="wrapper">
    <!--医生基础信息-->
    <el-row class="tag" v-if="doctor">
      <el-col :span="6">
        <p><span>ID：</span> <span>{{doctor.id}}</span></p>
        <p><span>科室：</span> <span>{{doctor.dept}}</span></p>
      </el-col>
      <el-col :span="6">
        <p><span>医生：</span> <span>{{doctor.name}}</span></p>
        <p><span>等级：</span> <span>{{doctor.level}}</span></p>
      </el-col>
      <el-col :span="6">
        <p><span>职称：</span> <span>{{doctor.title}}</span></p>
        <p><span>省份：</span> <span>{{doctor.province}}</span></p>
      </el-col>
      <el-col :span="6">
        <p><span>医院：</span> <span>{{doctor.unit}}</span></p>
        <p><span>城市：</span> <span>{{doctor.city}}</span></p>
      </el-col>
    </el-row>
    <!--搜索-->
    <div class="tag" style="margin-top: 20px">
      <el-row>
        <el-col :span="7">
          <el-input
            v-model="id"
            placeholder="请输入内容"
            size="small"
            @keyup.enter.native="search"
            style="width: 280px"></el-input>
          <el-button type="primary" size="small" @click="search">确定</el-button>
        </el-col>
        <el-col :span="9" :offset="8" style="text-align: right">
          <el-input v-model="name" placeholder="请输入内容" size="small" style="width: 280px"></el-input>
          <el-button type="success" size="small" @click="open">新任务</el-button>
        </el-col>
      </el-row>
    </div>
    <!--表格-->
    <div class="tag" style="margin-top: 20px">
      <el-tabs v-model="activeName">
        <!--基础数据-->
        <el-tab-pane name="basics" v-if="tab.basics">
                   <span slot="label">
                     <el-badge :value="count_1" class="item">基础数据</el-badge>
                   </span>
          <div>
            <el-row class="searchWord">
              <el-col :span="6">
                <span>相似度：</span>
                <el-select v-model="similarity1" placeholder="请选择" size="small">
                  <el-option
                    v-for="item in options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value">
                  </el-option>
                </el-select>
              </el-col>
              <el-col :span="6">
                <span>所在机构：</span>
                <el-input
                  style="width: 200px"
                  placeholder="请输入关键字"
                  icon="search"
                  class="search"
                  size="small"
                  v-model="employer1"></el-input>
              </el-col>
              <el-col :span="6">
                <el-button type="primary" size="small" @click="filtrate1()">确定</el-button>
              </el-col>
            </el-row>
            <el-table
              border
              :data="tableData1"
              style="width: 100%">
              <el-table-column prop="title" label="医生名">
                <template slot-scope="scope">
                  <a :href="scope.row.url" target="_Blank">{{scope.row.title}}</a>
                </template>
              </el-table-column>
              <el-table-column label="安进医院-科室">
                <template>
                  <span>{{doctor.unit}}-{{doctor.dept}}</span>
                </template>
              </el-table-column>
              <el-table-column prop="hospital" label="惠每医院"></el-table-column>
              <el-table-column prop="dept" label="惠每科室"></el-table-column>
              <el-table-column prop="value" label="相似度" sortable></el-table-column>
              <el-table-column width="160" label="操作">
                <template slot-scope="scope">
                  <el-button type="primary" plain size="mini" @click="handleEdit_1(scope.$index, scope.row)">关联
                  </el-button>
                  <el-button type="danger" plain size="mini" @click="unbind_1(scope.$index, scope.row)">解绑</el-button>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-tab-pane>
        <!--论文数据-->
        <el-tab-pane name="paper" v-if="tab.paper">
                <span slot="label">
                  <el-badge :value="count_2" class="item">论文数据</el-badge>
                </span>
          <div>
            <el-row class="searchWord">
              <el-col :span="6">
                <span>相似度：</span>
                <el-select v-model="similarity2" placeholder="请选择" size="small">
                  <el-option
                    v-for="item in options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value">
                  </el-option>
                </el-select>
              </el-col>
              <el-col :span="6">
                <span>所在机构：</span>
                <el-input
                  style="width: 200px"
                  placeholder="请输入关键字"
                  icon="search"
                  class="search"
                  size="small"
                  v-model="employer2"></el-input>
              </el-col>
              <el-col :span="6">
                <el-button type="primary" size="small" @click="filtrate2">确定</el-button>
              </el-col>
            </el-row>
            <el-table
              border
              :data="tableData2"
              style="width: 100%">
              <el-table-column prop="id" label="万方ID">
                <template slot-scope="scope">
                  <a :href='"http://med.wanfangdata.com.cn/Author/General/"+scope.row.id' target="_Blank">{{scope.row.id}}</a>
                </template>
              </el-table-column>
              <el-table-column prop="name" label="作者"></el-table-column>
              <el-table-column label="安进医院-科室">
                <template>
                  <span>{{doctor.unit}}</span>
                </template>
              </el-table-column>
              <el-table-column prop="unit" label="所在机构"></el-table-column>
              <el-table-column prop="value" label="相似度" sortable></el-table-column>
              <el-table-column width="160" label="操作">
                <template slot-scope="scope">
                  <el-button type="primary" plain size="mini" @click="handleEdit_2(scope,scope.row)">关联</el-button>
                  <el-button type="danger" plain size="mini" @click="unbind_2(scope.$index, scope.row)">解绑</el-button>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-tab-pane>
        <!--会议数据-->
        <el-tab-pane name="conference" v-if="tab.conference">
                        <span slot="label">
                          <el-badge :value="count_3" class="item">会议数据</el-badge>
                        </span>
          <div>
            <el-row class="searchWord">
              <el-col :span="6">
                <span>相似度：</span>
                <el-select v-model="similarity3" placeholder="请选择" size="small">
                  <el-option
                    v-for="item in options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value">
                  </el-option>
                </el-select>
              </el-col>
              <el-col :span="6">
                <span>所在机构：</span>
                <el-input
                  style="width: 200px"
                  placeholder="请输入关键字"
                  icon="search"
                  class="search"
                  size="small"
                  v-model="employer3"></el-input>
              </el-col>
              <el-col :span="6">
                <el-button type="primary" size="small" @click="filtrate3">确定</el-button>
              </el-col>
            </el-row>
            <el-table
              border
              :data="tableData3"
              style="width: 100%">
              <el-table-column prop="name" label="医生">
                <template slot-scope="scope">
                  <a :href="scope.row.url" target="_Blank">{{scope.row.name}}</a>
                </template>
              </el-table-column>
              <el-table-column label="安进医院-科室">
                <template>
                  <span>{{doctor.unit}}</span>
                </template>
              </el-table-column>
              <el-table-column prop="unit" label="所在机构"></el-table-column>
              <el-table-column prop="value" label="相似度" sortable></el-table-column>
              <el-table-column width="160" label="操作">
                <template slot-scope="scope">
                  <el-button type="primary" plain size="mini" @click="handleEdit_3(scope.$index, scope.row)">关联
                  </el-button>
                  <el-button type="danger" plain size="mini" @click="unbind_3(scope.$index, scope.row)">解绑</el-button>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-tab-pane>
        <!--中国临床-->
        <el-tab-pane name="cn_clinical" v-if="tab.cn_clinical">
                <span slot="label">
                  <el-badge :value="count_4" class="item">中国临床</el-badge>
                </span>
          <div>
            <el-row class="searchWord">
              <el-col :span="6">
                <span>所在机构：</span>
                <el-input
                  style="width: 200px"
                  placeholder="请输入关键字"
                  icon="search"
                  class="search"
                  size="small"
                  v-model="employer4"></el-input>
              </el-col>
              <el-col :span="6">
                <el-button type="primary" size="small" @click="filtrate4">确定</el-button>
              </el-col>
            </el-row>
            <el-table
              border
              :data="tableData4"
              style="width: 100%">
              <el-table-column prop="Registration_title" label="临床标题"></el-table-column>
              <el-table-column prop="reacher_disease" label="研究疾病"></el-table-column>
              <el-table-column prop="study_leader" label="研究负责人"></el-table-column>
              <el-table-column prop="multi_centers" label="多中心"></el-table-column>
              <el-table-column label="安进医院-科室">
                <template>
                  <span>{{doctor.unit}}</span>
                </template>
              </el-table-column>
              <el-table-column width="160" label="操作">
                <template slot-scope="scope">
                  <el-button type="primary" plain size="mini" @click="handleEdit_4(scope.$index, scope.row)">关联
                  </el-button>
                  <el-button type="danger" plain size="mini" @click="unbind_4(scope.$index, scope.row)">解绑</el-button>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-tab-pane>
        <!--药物临床-->
        <el-tab-pane name="drug_clinical" v-if="tab.drug_clinical">
                <span slot="label">
                  <el-badge :value="count_5" class="item">药物临床</el-badge>
                </span>
          <div>
            <el-row class="searchWord">
              <el-col :span="6">
                <span>所在机构：</span>
                <el-input
                  style="width: 200px"
                  placeholder="请输入关键字"
                  icon="search"
                  class="search"
                  size="small"
                  v-model="employer5"></el-input>
              </el-col>
              <el-col :span="6">
                <el-button type="primary" size="small" @click="filtrate5">确定</el-button>
              </el-col>
            </el-row>
            <el-table
              border
              :data="tableData5"
              style="width: 100%">
              <el-table-column prop="ctr_num" label="临床ID"></el-table-column>
              <el-table-column prop="test_topic" label="临床标题"></el-table-column>
              <el-table-column prop="indications" label="研究疾病"></el-table-column>
              <el-table-column prop="reacher_info" label="多中心">
                <template slot-scope="scope">
                  <p v-for="reacher_info in scope.row.reacher_insituation_info"><span>{{reacher_info.reacher_name}}-{{reacher_info.reacher_instituation}}-{{reacher_info.value}}</span>
                  </p>
                </template>
              </el-table-column>
              <el-table-column label="安进医院-科室">
                <template>
                  <span>{{doctor.unit}}</span>
                </template>
              </el-table-column>
              <el-table-column width="160" label="操作">
                <template slot-scope="scope">
                  <el-button type="primary" plain size="mini" @click="handleEdit_5(scope.$index, scope.row)">关联
                  </el-button>
                  <el-button type="danger" plain size="mini" @click="unbind_5(scope.$index, scope.row)">解绑</el-button>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-tab-pane>
        <!--科研-->
        <el-tab-pane name="cn_nature" v-if="tab.cn_nature">
                 <span slot="label">
                   <el-badge :value="count_6" class="item">科研</el-badge>
                 </span>
          <div>
            <el-row class="searchWord">
              <el-col :span="6">
                <span>相似度：</span>
                <el-select v-model="similarity6" placeholder="请选择" size="small">
                  <el-option
                    v-for="item in options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value">
                  </el-option>
                </el-select>
              </el-col>
              <el-col :span="6">
                <span>所在机构：</span>
                <el-input
                  style="width: 200px"
                  placeholder="请输入关键字"
                  icon="search"
                  class="search"
                  size="small"
                  v-model="employer6"></el-input>
              </el-col>
              <el-col :span="6">
                <el-button type="primary" size="small" @click="filtrate6">确定</el-button>
              </el-col>
            </el-row>
            <el-table
              border
              :data="tableData6"
              style="width: 100%">
              <el-table-column prop="title" label="科研标题">
                <template slot-scope="scope">
                  <a :href="scope.row.url" target="_Blank">{{scope.row.chineseTitle}}</a>
                </template>
              </el-table-column>
              <el-table-column prop="authors" label="医生"></el-table-column>
              <el-table-column prop="value" label="相似度" sortable></el-table-column>
              <el-table-column prop="organization" label="医院"></el-table-column>
              <el-table-column label="安进医院-科室">
                <template>
                  <span>{{doctor.unit}}</span>
                </template>
              </el-table-column>
              <el-table-column label="摘要">
                <template scope="scope">
                  <el-input v-model="scope.row.digest"></el-input>
                </template>
              </el-table-column>
              <el-table-column width="160" label="操作">
                <template slot-scope="scope">
                  <el-button type="primary" plain size="mini" @click="handleEdit_6(scope.$index, scope.row)">关联
                  </el-button>
                  <el-button type="danger" plain size="mini" @click="unbind_6(scope.$index, scope.row)">解绑</el-button>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-tab-pane>
        <!--英文临床-->
        <el-tab-pane name="en_clinical" v-if="tab.en_clinical">
                        <span slot="label">
                          <el-badge :value="count_7" class="item">英文临床</el-badge>
                        </span>
          <div>
            <el-table
              border
              :data="tableData7"
              style="width: 100%">
              <el-table-column prop="hcp_name" label="医生名"></el-table-column>
              <el-table-column prop="hcp_name_en" label="医生英文名"></el-table-column>
              <el-table-column prop="hco_name" label="医院名"></el-table-column>
              <el-table-column prop="hco_name_en" label="医院英文名"></el-table-column>
              <el-table-column prop="data_hco_name" label="数据的英文医院">
                <template slot-scope="scope">
                  <span v-html="scope.row.data_hco_name"></span>
                </template>
              </el-table-column>
              <el-table-column prop="value" label="相似度" sortable></el-table-column>
              <el-table-column width="160" label="操作">
                <template slot-scope="scope">
                  <el-button type="primary" plain size="mini" @click="handleEdit_7(scope.$index, scope.row)">关联
                  </el-button>
                  <el-button type="danger" plain size="mini" @click="unbind_7(scope.$index, scope.row)">解绑</el-button>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-tab-pane>
        <!--英文论文-->
        <el-tab-pane name="pubmeds" v-if="tab.pubmeds">
          <span slot="label">
            <el-badge :value="count_8" class="item">英文论文</el-badge>
          </span>
          <div>
            <el-table
              border
              :data="tableData8"
              style="width: 100%">
              <el-table-column prop="hcp_name" label="医生名"></el-table-column>
              <el-table-column prop="hco_name" label="医院名"></el-table-column>
              <el-table-column prop="hco_name_en" label="医院英文名"></el-table-column>
              <el-table-column prop="affiliation" label="数据的英文医院">
                <template slot-scope="scope">
                  <span v-html="scope.row.affiliation"></span>
                </template>
              </el-table-column>
              <el-table-column width="160" label="操作">
                <template slot-scope="scope">
                  <el-button type="primary" plain size="mini" @click="handleEdit_8(scope.$index, scope.row)">关联
                  </el-button>
                  <el-button type="danger" plain size="mini" @click="unbind_8(scope.$index, scope.row)">解绑</el-button>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-tab-pane>
        <!--命名识别-->
        <el-tab-pane name="drag" v-if="tab.drag">
          <span slot="label"><el-badge class="item">命名识别</el-badge></span>
          <div style="margin: 0 30px">
            <el-row>
              <el-form class="demo-form-inline">
                <el-col :span="8">
                  <el-form-item label="医院教学职务:">
                    <el-input class="ipt" size="small" v-model="edu_title" clearable></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="医院行政职务:">
                    <el-input class="ipt" size="small" v-model="adm_title" clearable></el-input>
                  </el-form-item>
                </el-col>
              </el-form>

            </el-row>
            <div>
              <h5 v-html="this.original"
                  style="font-weight: bold;color: #7b7b7b;line-height: 25px;min-height: 20px"></h5>
              <!--学习经历-->
              <h1>
                <el-button type="success" size="small" @click="studyExperience_click">添加学习经历</el-button>
              </h1>
              <el-table :data="studyExperience" border style="width: 100%">
                <el-table-column prop="time" label="时间">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.time" clearable size="small"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="schoolName" label="学校">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.schoolName" clearable size="small"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="isOverseas" label="是否海外经历">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.isOverseas" clearable size="small"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="major" label="专业">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.major" clearable size="small"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="record" label="学历">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.record" clearable size="small"></el-input>
                  </template>
                </el-table-column>
                <el-table-column label="操作" width="80">
                  <template slot-scope="scope">
                    <el-button size="small" type="danger" @click="handleDelete1(scope.$index, scope.row)">删除</el-button>
                  </template>
                </el-table-column>
              </el-table>
              <!--协会任职-->
              <h1>
                <el-button type="success" size="small" @click="associationFor_click">添加协会任职</el-button>
              </h1>
              <el-table :data="associationFor" border style="width: 100%">
                <el-table-column prop="time" label="时间">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.time" clearable size="small"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="assName" label="协会">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.assName" clearable size="small"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="title" label="任职">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.title" clearable size="small"></el-input>
                  </template>
                </el-table-column>
                <el-table-column label="操作" width="80">
                  <template slot-scope="scope">
                    <el-button size="small" type="danger" @click="handleDelete2(scope.$index, scope.row)">删除</el-button>
                  </template>
                </el-table-column>
              </el-table>
              <!--杂志-->
              <h1>
                <el-button type="success" size="small" @click="magazine_click">添加杂志</el-button>
              </h1>
              <el-table :data="magazine" border style="width: 100%">
                <el-table-column prop="time" label="时间">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.time" clearable size="small"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="journalName" label="杂志">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.journalName" clearable size="small"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="title" label="任职">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.title" clearable size="small"></el-input>
                  </template>
                </el-table-column>
                <el-table-column label="操作" width="80">
                  <template slot-scope="scope">
                    <el-button size="small" type="danger" @click="handleDelete3(scope.$index, scope.row)">删除</el-button>
                  </template>
                </el-table-column>
              </el-table>
              <!--获奖-->
              <h1>
                <el-button type="success" size="small" @click="bearThePalm_click">添加获奖</el-button>
              </h1>
              <el-table :data="bearThePalm" border style="width: 100%">
                <el-table-column prop="time" label="时间">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.time" clearable size="small"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="assName" label="获奖">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.awardName" clearable size="small"></el-input>
                  </template>
                </el-table-column>
                <el-table-column label="操作" width="80">
                  <template slot-scope="scope">
                    <el-button size="small" type="danger" @click="handleDelete4(scope.$index, scope.row)">删除</el-button>
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </div>
          <div style="margin-top: 20px;text-align: center">
            <el-button type="primary" size="small" @click="submit">提交</el-button>
          </div>
        </el-tab-pane>
      </el-tabs>
    </div>
    <!--回到顶部-->
    <el-backtop></el-backtop>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        activeName: 'drag',
        tab: {
          basics: false,
          paper: false,
          conference: false,
          cn_clinical: false,
          drug_clinical: false,
          cn_nature: false,
          en_clinical: false,
          pubmeds: false,
          drag: true,
        },
        /*id搜索*/
        id: '',
        /*已完成搜索*/
        name: '',
        /*搜索*/
        obj: {
          amgenHcpAjId: '',
          workName: '',
          status: '',
          insert: '',
        },
        /*医生基础信息*/
        doctor: {},
        /*计数*/
        count_1: 0,
        count_2: 0,
        count_3: 0,
        count_4: 0,
        count_5: 0,
        count_6: 0,
        count_7: 0,
        count_8: 0,
        /*筛选*/
        /*相似度*/
        similarity1: '无',
        similarity2: '无',
        similarity3: '无',
        similarity6: '无',
        similarity7: '无',
        options: [
          {
            value: '无',
            label: '无'
          },
          {
            value: '0.1',
            label: '≥0.1'
          },
          {
            value: '0.2',
            label: '≥0.2'
          },
          {
            value: '0.3',
            label: '≥0.3'
          },
          {
            value: '0.4',
            label: '≥0.4'
          },
          {
            value: '0.5',
            label: '≥0.5'
          },
          {
            value: '0.6',
            label: '≥0.6'
          },
          {
            value: '0.7',
            label: '≥0.7'
          },
          {
            value: '0.8',
            label: '≥0.8'
          },
          {
            value: '0.9',
            label: '≥0.9'
          },
        ],
        //所在机构
        employer1: '',
        employer2: '',
        employer3: '',
        employer4: '',
        employer5: '',
        employer6: '',
        employer7: '',
        employer8: '',

        /*表格数据*/
        tableData1: [],
        tableData1_1: [],
        tableData2: [],
        tableData2_1: [],
        tableData3: [],
        tableData3_1: [],
        tableData4: [],
        tableData4_1: [],
        tableData5: [],
        tableData5_1: [],
        tableData6: [],
        tableData6_1: [],
        tableData7: [],
        tableData7_1: [],
        tableData8: [],
        tableData8_1: [],

        /*基础数据*/

        /*论文数据*/

        /*会议数据*/

        /*命名识别*/

        /*学习经历*/
        studyExperience: [],
        /*协会任职*/
        associationFor: [],
        /*杂志*/
        magazine: [],
        /*获奖*/
        bearThePalm: [],

        edu_title: '',
        adm_title: '',
        academics: [],
        scientifics: [],

        fullscreenLoading: false,
        /*命名识别，高亮*/
        original: '',
        red: 'color:#FF3300;',
        olivine: 'color:#FF6600;',
        orange: 'color:#FE9901;',
      }
    },
    mounted() {
      if (localStorage.getItem('name')) {
        setTimeout(() => {
          this.name = localStorage.getItem('name');
        }, 100);
      } else {
        this.name = '';
      }
    },
    methods: {
      /*搜索*/
      search() {
        if (this.id) {
          this.obj = {
            amgenHcpAjId: '',
            workName: '',
            status: '',
            insert: '',
          };
          if (this.doctor.id) {
            this.obj.tf = true;
            if (this.activeName != 'drag') {
              this.obj.amgenHcpAjId = this.id;
              this.obj.status = 1;
              this.httpPost('/amgenHcp/hcpData', this.obj)
            } else {
              this.obj.amgenHcpAjId = this.id;
              this.obj.status = 1;
              this.httpPost('/amgenHcp/hcpData', this.obj)
            }
          } else {
            this.obj.tf = false;
            if (this.activeName != 'drag') {
              this.obj.amgenHcpAjId = this.id;
              this.obj.status = 1;
              this.httpPost('/amgenHcp/hcpData', this.obj)
            } else {
              this.obj.amgenHcpAjId = this.id;
              this.obj.status = 1;
              this.httpPost('/amgenHcp/hcpData', this.obj)
            }
          }

        }
      },
      /*已完成*/
      open() {
        if (this.name) {
          this.obj = {
            amgenHcpAjId: '',
            workName: '',
            status: '',
            insert: '',
          };
          this.$confirm('此医生数据是否已完成?', '提示', {
            type: 'warning',
            confirmButtonText: '确定',
            cancelButtonText: '取消',
          }).then(() => {
            this.fullscreenLoading = true;
            localStorage.setItem('name', this.name);
            if (this.doctor.id) {
              this.obj.tf = true;
              this.obj.insert = this.insert;
              if (this.activeName != 'drag') {
                this.obj.workName = this.name;
                this.obj.status = 1;
                this.httpPost('/amgenHcp/hcpData', this.obj)
              } else {
                this.obj.workName = this.name;
                this.obj.status = 1;
                this.httpPost('/amgenHcp/hcpData', this.obj)
              }
            } else {
              this.obj.tf = false;
              this.obj.insert = this.insert;
              if (this.activeName != 'drag') {
                this.obj.workName = this.name;
                this.obj.status = 1;
                this.httpPost('/amgenHcp/hcpData', this.obj)
              } else {
                this.obj.workName = this.name;
                this.obj.status = 1;
                this.httpPost('/amgenHcp/hcpData', this.obj)
              }
            }
          }).catch(() => {
            this.$message({type: 'info', message: '已取消'});
          });
        }
      },
      /*Post*/
      httpPost(aip, parameter) {
        this.tableData1 = [];
        this.tableData2 = [];
        this.tableData3 = [];
        this.tableData4 = [];
        this.tableData5 = [];
        this.tableData6 = [];
        this.tableData7 = [];
        this.tableData8 = [];
        this.count_1 = 0;
        this.count_2 = 0;
        this.count_3 = 0;
        this.count_4 = 0;
        this.count_5 = 0;
        this.count_6 = 0;
        this.count_7 = 0;
        this.count_8 = 0;
        this.$http.httpPost(aip, parameter).then((response) => {
            //console.log(JSON.stringify(response));
            this.activeName = 'drag';
            if (response.data) {
              this.insert = response.data.insert;
              localStorage.setItem('id', response.data.id);
              /*医生基础信息*/
              if (response.data.dataInfo.aj) {
                this.doctor = response.data.dataInfo.aj;
                this.doctor.id = response.data.id
              }
              /*基础数据*/
/*              if (response.data.dataInfo.hm.length > 0) {
                this.count_1 = response.data.dataInfo.hm.length;
                this.tableData1 = response.data.dataInfo.hm;
                this.tableData1_1 = this.tableData1;
              }*/
              /*论文数据*/
/*              if (response.data.dataInfo.wanfang_authors.length > 0) {
                this.count_2 = response.data.dataInfo.wanfang_authors.length;
                this.tableData2 = response.data.dataInfo.wanfang_authors;
                this.tableData2_1 = this.tableData2;
              }*/
              /*会议数据*/
/*              if (response.data.dataInfo.meetings.length > 0) {
                this.count_3 = response.data.dataInfo.meetings.length;
                this.tableData3 = response.data.dataInfo.meetings;
                this.tableData3_1 = this.tableData3;
              }*/
              /*中国临床*/
/*              if (response.data.dataInfo.cn_clinical.length > 0) {
                this.count_4 = response.data.dataInfo.cn_clinical.length;
                this.tableData4 = response.data.dataInfo.cn_clinical;
                this.tableData4_1 = this.tableData4;
              }*/
              /*药物临床*/
/*              if (response.data.dataInfo.drug_clinical.length > 0) {
                this.count_5 = response.data.dataInfo.drug_clinical.length;
                this.tableData5 = response.data.dataInfo.drug_clinical;
                this.tableData5_1 = this.tableData5;
              }*/
              /*科研*/
/*              if (response.data.dataInfo.cn_nature.length > 0) {
                this.count_6 = response.data.dataInfo.cn_nature.length;
                this.tableData6 = response.data.dataInfo.cn_nature;
                this.tableData6_1 = this.tableData6;
              }*/
              /*英文临床*/
/*              if (response.data.dataInfo.en_clinical.length > 0) {
                this.count_7 = response.data.dataInfo.en_clinical.length;
                for (let i of response.data.dataInfo.en_clinical) {
                  for (let a of i.hco_name_en.split(' ')) {
                    let values = i.data_hco_name.split(a);
                    i.data_hco_name = values.join('<font  style="color:#FF6600;">' + a + '</font >');
                  }
                  this.tableData7.push(i)
                }
                this.tableData7_1 = this.tableData7;
              }*/
              /*英文论文*/
/*              if (response.data.dataInfo.pubmeds.length > 0) {
                this.count_8 = response.data.dataInfo.pubmeds.length;
                for (let i of response.data.dataInfo.pubmeds) {
                  for (let a of i.hco_name_en.split(' ')) {
                    let values = i.affiliation.split(a);
                    i.affiliation = values.join('<font  style="color:#FF6600;">' + a + '</font >');
                  }
                  this.tableData8.push(i)
                }
                this.tableData8_1 = this.tableData8;
              }*/
              /*命名识别*/
              this.edu_title = '';
              this.adm_title = '';
              this.academics = [];
              this.scientifics = [];
              this.original = '';
              this.studyExperience = [];
              this.associationFor = [];
              this.magazine = [];
              this.bearThePalm = [];
              if (JSON.stringify(response.data.pretreatmentInfo) != '{}') {

                this.later = true;
                this.front = false;

                if (response.data.pretreatmentInfo.edu_title) {
                  this.edu_title = response.data.pretreatmentInfo.edu_title;

                }
                if (response.data.pretreatmentInfo.adm_title) {
                  this.adm_title = response.data.pretreatmentInfo.adm_title;
                }

                this.academics = response.data.pretreatmentInfo.academics;
                this.scientifics = response.data.pretreatmentInfo.scientifics;

                this.original = response.data.specialty;

                this.highlight(response.data.pretreatmentInfo.dept, this.red);
                this.highlight(response.data.pretreatmentInfo.person, this.red);
                this.highlight(response.data.pretreatmentInfo.zhiji, this.red);

                this.studyExperience = response.data.pretreatmentInfo.school;
                this.associationFor = response.data.pretreatmentInfo.ass;
                this.magazine = response.data.pretreatmentInfo.journal;
                this.bearThePalm = response.data.pretreatmentInfo.award;

                for (let a of response.data.pretreatmentInfo.ass) {
                  this.highlight(a.assName, this.olivine);
                  this.highlight(a.time, this.olivine);
                  this.highlight(a.title, this.olivine);
                }
                for (let b of response.data.pretreatmentInfo.school) {
                  this.highlight(b.record, this.orange);
                  this.highlight(b.major, this.orange);
                  this.highlight(b.schoolName, this.orange);
                  this.highlight(b.time, this.orange);
                }
                for (let c of response.data.pretreatmentInfo.award) {
                  this.highlight(c.time, this.orange);
                  this.highlight(c.awardName, this.orange);
                }
              }
            }
          }
        )
      },
      /*高亮*/
      highlight(parameter, colour) {
        if (parameter) {
          if (parameter.length >= 4 && this.original.indexOf(parameter) != -1) {
            let values = this.original.split(parameter);
            this.original = values.join('<font  style=' + colour + '>' + parameter + '</font >');
          }
          if (parameter.length < 4 && this.original.indexOf(parameter) != -1) {
            let values = this.original.split(parameter);
            this.original = values.join('<font  style=' + colour + '>' + parameter + '</font >');
          }
        }
      },
      /*基础数据*/
      handleEdit_1(index, row) {
        let obj = {
          data: {
            haodaifu_url: row.url,
            specialty: row.special,
            skill: row.experience,
            id: localStorage.getItem('id')
          },
          tf: true
        };
        this.relevance_unbind_httpPost('/amgenHcp/updateBasics', obj)
      },
      unbind_1(index, row) {
        let obj = {
          data: {
            haodaifu_url: '',
            specialty: '',
            skill: '',
            id: localStorage.getItem('id')
          },
          tf: false
        };
        this.relevance_unbind_httpPost('/amgenHcp/updateBasics', obj)
      },
      /*论文数据*/
      handleEdit_2(index, row) {
        let obj = {
          wId: row.id,
          id: localStorage.getItem('id'),
          tf: true
        };
        this.relevance_unbind_httpPost('/amgenHcp/updateWanfang', obj)
      },
      unbind_2(index, row) {
        let obj = {
          wId: row.id,
          id: localStorage.getItem('id'),
          tf: false
        };
        this.relevance_unbind_httpPost('/amgenHcp/updateWanfang', obj)
      },
      /*会议数据*/
      handleEdit_3(index, row) {
        let obj = {
          mId: row.url,
          id: localStorage.getItem('id'),
          tf: true
        };
        this.relevance_unbind_httpPost('/amgenHcp/updateMeeting', obj)
      },
      unbind_3(index, row) {
        let obj = {
          mId: row.url,
          id: localStorage.getItem('id'),
          tf: false
        };
        this.relevance_unbind_httpPost('/amgenHcp/updateMeeting', obj)
      },
      /*中国临床*/
      handleEdit_4(index, row) {
        let obj = {
          id: localStorage.getItem('id'),
          cId: row.id,
          tf: true
        };
        this.relevance_unbind_httpPost('/amgenHcp/updateCNClinical', obj)
      },
      unbind_4(index, row) {
        let obj = {
          id: localStorage.getItem('id'),
          cId: row.id,
          tf: false
        };
        this.relevance_unbind_httpPost('/amgenHcp/updateCNClinical', obj)
      },
      /*药物临床*/
      handleEdit_5(index, row) {
        let obj = {
          id: localStorage.getItem('id'),
          cId: row.id,
          tf: true
        };
        this.relevance_unbind_httpPost('/amgenHcp/updateDrugClinical', obj)
      },
      unbind_5(index, row) {
        let obj = {
          id: localStorage.getItem('id'),
          cId: row.id,
          tf: false
        };
        this.relevance_unbind_httpPost('/amgenHcp/updateDrugClinical', obj)
      },
      /*科研*/
      handleEdit_6(index, row) {
        let obj = {
          id: localStorage.getItem('id'),
          pId: row.id,
          summary: row.digest,
          tf: true
        };
        this.relevance_unbind_httpPost('/amgenHcp/updateProject', obj)
      },
      unbind_6(index, row) {
        let obj = {
          id: localStorage.getItem('id'),
          pId: row.id,
          summary: row.digest,
          tf: false
        };
        this.relevance_unbind_httpPost('/amgenHcp/updateProject', obj)
      },
      /*英文临床*/
      handleEdit_7(index, row) {
        let obj = {
          id: localStorage.getItem('id'),
          enId: row.nct_id,
          tf: true
        };
        this.relevance_unbind_httpPost('/amgenHcp/updateEnClinical', obj)
      },
      unbind_7(index, row) {
        let obj = {
          id: localStorage.getItem('id'),
          enId: row.nct_id,
          tf: false
        };
        this.relevance_unbind_httpPost('/amgenHcp/updateEnClinical', obj)
      },
      /*英文论文*/
      handleEdit_8(index, row) {
        let obj = {
          id: localStorage.getItem('id'),
          pId: row.pid,
          tf: true
        };
        this.relevance_unbind_httpPost('/amgenHcp/updatePubmed', obj)
      },
      unbind_8(index, row) {
        let obj = {
          id: localStorage.getItem('id'),
          pId: row.pid,
          tf: false
        };
        this.relevance_unbind_httpPost('/amgenHcp/updatePubmed', obj)
      },

      relevance_unbind_httpPost(aip, parameter) {
        this.$http.httpPost(aip, parameter).then((response) => {
          if (response.data) {
            this.$message({type: 'success', message: response.data.message});
          }
        }).catch((error) => {
          console.log(error)
        });
      },
      /*命名识别*/
      studyExperience_click() {
        this.studyExperience.push({time: '', schoolName: '', major: '', record: '', isOverseas: ''})
      },
      handleDelete1(index, row) {
        this.studyExperience.splice(index, 1);
      },

      associationFor_click() {
        this.associationFor.push({time: '', assName: '', title: '',})
      },
      handleDelete2(index, row) {
        this.associationFor.splice(index, 1);
      },

      magazine_click() {
        this.magazine.push({time: '', journalName: '', title: '',})
      },
      handleDelete3(index, row) {
        this.magazine.splice(index, 1);
      },

      bearThePalm_click() {
        this.bearThePalm.push({time: '', awardName: '',})
      },
      handleDelete4(index, row) {
        this.bearThePalm.splice(index, 1);
      },

      submit() {
        if (this.doctor.id) {
          let obj = {
            id: localStorage.getItem('id'),
            processedInfo: {
              ass: this.associationFor,
              school: this.studyExperience,
              award: this.bearThePalm,
              journal: this.magazine,
              edu_title: this.edu_title,
              adm_title: this.adm_title,
              academics: this.academics,
              scientifics: this.scientifics,
            },
          };
          this.$http.httpPost('/amgenHcp/updateProcessedInfo', JSON.stringify(obj)).then((response) => {
            if (response.data.state) {
              this.$message({type: 'success', message: response.data.message});
            }
          }).catch((error) => {
            console.log(error)
          });
        }
      },

      /*筛选*/
      filtrate1() {
        if (this.doctor.id) {
          this.tableData1 = [];
          if (this.similarity1 != '无' && this.employer1) {
            for (let data of this.tableData1_1) {
              if (data.value >= this.similarity1 && ~data.hospital.indexOf(this.employer1)) {
                this.tableData1.push(data);
              }
            }
          } else if (this.similarity1 != '无') {
            for (let data of this.tableData1_1) {
              if (data.value >= this.similarity1) {
                this.tableData1.push(data);
              }
            }
          } else if (this.employer1) {
            for (let data of this.tableData1_1) {
              if (~data.hospital.indexOf(this.employer1)) {
                this.tableData1.push(data);
              }
            }
          } else {
            this.tableData1 = this.tableData1_1
          }
        }
      },
      filtrate2() {
        if (this.doctor.id) {
          this.tableData2 = [];
          if (this.similarity2 != '无' && this.employer2) {
            for (let data of this.tableData2_1) {
              if (data.value >= this.similarity2 && ~data.unit.indexOf(this.employer2)) {
                this.tableData2.push(data);
              }
            }
          } else if (this.similarity2 != '无') {
            for (let data of this.tableData2_1) {
              if (data.value >= this.similarity2) {
                this.tableData2.push(data);
              }
            }
          } else if (this.employer2) {
            for (let data of this.tableData2_1) {
              if (~data.unit.indexOf(this.employer2)) {
                this.tableData2.push(data);
              }
            }
          } else {
            this.tableData2 = this.tableData2_1
          }
        }
      },
      filtrate3() {
        if (this.doctor.id) {
          this.tableData3 = [];
          if (this.similarity3 != '无' && this.employer3) {
            for (let data of this.tableData3_1) {
              if (data.value >= this.similarity3 && ~data.unit.indexOf(this.employer3)) {
                this.tableData3.push(data);
              }
            }
          } else if (this.similarity3 != '无') {
            for (let data of this.tableData3_1) {
              if (data.value >= this.similarity3) {
                this.tableData3.push(data);
              }
            }
          } else if (this.employer3) {
            for (let data of this.tableData3_1) {
              if (~data.unit.indexOf(this.employer3)) {
                this.tableData3.push(data);
              }
            }
          } else {
            this.tableData3 = this.tableData3_1;
          }
        }
      },
      filtrate4() {
        if (this.doctor.id) {
          this.tableData4 = [];
          if (this.employer4) {
            for (let data of this.tableData4_1) {
              if (~data.multi_centers.indexOf(this.employer4)) {
                this.tableData4.push(data);
              }
            }
          } else {
            this.tableData4 = this.tableData4_1;
          }
        }
      },
      filtrate5() {
        if (this.doctor.id) {
          this.tableData5 = [];
          if (this.employer5) {
            for (let data of this.tableData5_1) {
              if (~data.hospital.indexOf(this.employer5)) {
                this.tableData5.push(data);
              }
            }
          } else {
            this.tableData5 = this.tableData5_1;
          }
        }
      },
      filtrate6() {
        if (this.doctor.id) {
          this.tableData6 = [];
          if (this.similarity6 != '无' && this.employer6) {
            for (let data of this.tableData6_1) {
              if (data.value >= this.similarity6 && ~data.organization.indexOf(this.employer6)) {
                this.tableData6.push(data)
              }
            }
          } else if (this.similarity6 != '无') {
            for (let data of this.tableData6_1) {
              if (data.value >= this.similarity6) {
                this.tableData6.push(data);
              }
            }
          } else if (this.employer6) {
            for (let data of this.tableData6_1) {
              if (~data.organization.indexOf(this.employer6)) {
                this.tableData6.push(data);
              }
            }
          } else {
            this.tableData6 = this.tableData6_1;
          }
        }
      },
    },
  }
</script>

<style scoped>
  .wrapper {
    padding: 30px 20px;
    width: 1366px;
    margin: 0 auto;
  }

  .wrapper .tag {
    background: #fff;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 6px 6px 5px #ccc;
  }

  .wrapper .searchWord {
    margin: 10px 0;
  }

  .ipt {
    width: 300px;
  }
</style>
<style>
  .el-tabs__nav {
    margin-top: 20px;
  }
</style>
